<template>
  <!--明细页面弹出框-->
  <el-dialog
    title="大小额贷记来账手工处理审核明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="150px">
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>基本信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易流水号：" prop="id">
              <el-input v-model="formData.id" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报文类型：" prop="pkgno">
              <el-select v-model="formData.pkgno" placeholder="" style="width: 100%" disabled>
                <el-option
                  v-for="dict in dictMap.PKG_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="工作日期：" prop="workdate">
              <el-date-picker
                v-model="formData.workdate"
                type="date"
                value-format="yyyyMMdd"
                placeholder=""
                disabled
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="CPG日期：" prop="vdate">
              <el-date-picker
                v-model="formData.vdate"
                type="date"
                value-format="yyyyMMdd"
                placeholder=""
                disabled
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="系统编号：" prop="sysCode">
              <el-select v-model="formData.sysCode" placeholder="" style="width: 100%" disabled>
                <el-option
                  v-for="dict in dictMap.TXN_SYSCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="业务类型：" prop="bizTypeCode">
              <el-select v-model="formData.bizTypeCode" placeholder="" disabled style="width: 100%">
                <el-option
                  v-for="dict in dictMap.BIZ_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select style="width: 100%;"
                         v-model="formData.bizCtgyCode===null||formData.bizCtgyCode===undefined?'':formData.bizCtgyCode+'-'+formData.bizCtgyCodeDesc"
                         placeholder="业务种类" :disabled="true"
              >

              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="货币种类：" prop="curcd">
              <el-input v-model="formData.curcd" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="金额：" prop="amount">
              <el-input v-model="formData.amount" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言" prop="remarks">
              <el-input type="textarea" v-model="formData.remarks" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人账号：" prop="payerActno">
              <el-input v-model="formData.payerActno" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款人名称：" prop="payerName">
              <el-input v-model="formData.payerName" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款行行号：" prop="payerBrno">
              <el-input v-model="formData.payerBrno" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款行行名：" prop="payerBrname">
              <el-input v-model="formData.payerBrname" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="付款人开户行行号：" prop="payerAccBrno">
              <el-input v-model="formData.payerAccBrno" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款人开户行行名：" prop="payerAccBrName">
              <el-input v-model="formData.payerAccBrName" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <div v-if="this.formData.nstpOptype!=='03'">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款人账号：" prop="payeeActnoNew">
              <el-input v-model="formData.payeeActnoNew" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款人名称：" prop="payeeNameNew">
              <el-input v-model="formData.payeeNameNew" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款行行号：" prop="payeeBrnoNew">
              <el-input v-model="formData.payeeBrnoNew" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款行行名：" prop="payeeBrnameNew">
              <el-input v-model="formData.payeeBrnameNew" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="收款人开户行行号：" prop="payeeAccBrno">
              <el-input v-model="formData.payeeAccBrno" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款人开户行行名：" prop="payeeAccBrName">
              <el-input v-model="formData.payeeAccBrName" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card payerInfo-card">
        <div slot="header" class="label-header-msg">
          <span>手工处理信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="操作类型：" prop="nstpOptype">
              <el-select v-model="formData.nstpOptype" placeholder="" style="width: 100%" disabled>
                <el-option
                  v-for="dict in dictMap.NSTP_OPTYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="接收时间：" prop="rcvTime">
              <el-date-picker
                v-model="formData.rcvTime"
                type="datetime"
                disabled
                value-format="yyyyMMddHHmmss"
                placeholder=""
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="录入操作员：" prop="mdTlrno">
              <el-input v-model="formData.mdTlrno" placeholder="" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="录入时间：" prop="mdTime">
              <el-date-picker
                v-model="formData.mdTime"
                type="datetime"
                value-format="yyyyMMddHHmmss"
                placeholder=""
                disabled
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="non-stp类型：" prop="nstpType">
              <el-select v-model="formData.nstpType" placeholder="" style="width: 100%" disabled>
                <el-option
                  v-for="dict in dictMap.NON_STP_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="non-STP原因：" prop="nstpRemarks">
              <el-input type="textarea" v-model="formData.nstpRemarks" placeholder="" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="approve" :loading="isLoading">审核</el-button>
      <el-button type="danger" @click="reject" :loading="isLoading">拒绝</el-button>
      <el-button @click="closeFn">取消</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { approve, reject } from "@/api/cnaps/beps/baseHandWork/hvps_beps_credit_vostro_hdwk_approve.js";
export default {
  name: "HvpsBepsCreditVostroHdWkApproveDetails",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      // 是否显示弹出层
      open: false,
      isLoading: false,
    };
  },
  mounted() {},
  methods: {
    //审核
    approve() {
      this.isLoading = true;
      approve({ ...this.formData })
        .then((res) => {
          this.isLoading = false;
          this.$emit("editComplete", true);
          this.msgSuccess("成功!");
          this.closeFn();
        })
        .catch((err) => {
          this.isLoading = false;
          //   this.$alert(`${res.result}`, "系统提示", {
          //     confirmButtonText: "确认",
          //     type: "error",
          //     callback: (action) => {},
        });
    },
    //拒绝
    reject() {
      this.isLoading = true;
      reject({ ...this.formData })
        .then((res) => {
          this.isLoading = false;
          this.$emit("editComplete", true);
          this.msgSuccess("成功!");
          this.closeFn();
        })
        .catch((err) => {
          this.isLoading = false;
          //   this.$alert(`${res.result}`, "系统提示", {
          //     confirmButtonText: "确认",
          //     type: "error",
          //     callback: (action) => {},
        });
    },
    // 表单重置
    reset() {
      this.resetForm("detailsForm");
    },
    closeFn() {
      this.open = false;
      this.reset();
    },
    show() {
      this.open = true;
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
